Skip to content

Conversation

@SnipsMine
Copy link

@SnipsMine SnipsMine commented Feb 6, 2024

Description

I ran into a problem that nothing was printed when 0 was given as the value for function TemplateProcessor->setValue(). I tracked this issue down to the function ensureUtf8Encoded that checked if $subject was true, instead of is not null.

I changed the line to check if $subject is null and only then return a empty string else the value is send to Text::toUTF8().

The test I wrote might be a bit overkill, but I hope it sufficient to test te fix

Checklist:

  • I have run composer run-script check --timeout=0 and no errors were reported
  • The new code is covered by unit tests (check build/coverage for coverage report)
  • I have updated the documentation to describe the changes

SnipsMine and others added 2 commits February 6, 2024 20:02
I changed the function ensureUtf8Encoded so that it only returns an empty string when it is null.
@coveralls
Copy link

coveralls commented Feb 6, 2024

Coverage Status

coverage: 97.217%. remained the same
when pulling cb1ba73 on SnipsMine:master
into 8b891bb on PHPOffice:master.

@Progi1984
Copy link
Member

Superseeds by #2748

@Progi1984 Progi1984 closed this Feb 12, 2025
@Progi1984 Progi1984 added this to the 1.4.0 milestone Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants